﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Register.aspx.vb" Inherits="TWIN_test.Register1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Registration</title>
</head>
<body background="../../Images/Training-Employee-Background.gif">
    <form id="form1" runat="server">
    <center><div>
        <font color="white"><h1>Workshop Details</h1></font><br />
    </div>
    
        <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
            DataKeyNames="ID" DataSourceID="SqlDataSource1" Height="50px" Width="125px" BackColor="White" BorderColor="White" BorderStyle="None" BorderWidth="5px" 
            CellPadding="2" CellSpacing="2">
            <Fields>
                <asp:BoundField DataField="TITLE" HeaderText="TITLE" SortExpression="TITLE" />
                <asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True" 
                    SortExpression="ID" />
                <asp:BoundField DataField="DESCRIPTION" HeaderText="DESCRIPTION" 
                    SortExpression="DESCRIPTION" />
                <asp:BoundField DataField="WORKSHOPSTART" HeaderText="WORKSHOPSTART" 
                    SortExpression="WORKSHOPSTART" />
                <asp:BoundField DataField="WORKSHOPFINISH" HeaderText="WORKSHOPFINISH" 
                    SortExpression="WORKSHOPFINISH" />
                <asp:BoundField DataField="LOCATION" HeaderText="LOCATION" 
                    SortExpression="LOCATION" />
                <asp:BoundField DataField="FIRSTNAME" HeaderText="FIRSTNAME" 
                    SortExpression="FIRSTNAME" />
                <asp:BoundField DataField="LASTNAME" HeaderText="LASTNAME" 
                    SortExpression="LASTNAME" />
            </Fields>
        </asp:DetailsView>
        <br />
        <center>
            <asp:Button ID="registerWorkshopButton" runat="server" Text="Register for Workshop" 
                Font-Bold="True" /></center>
        <br />
    
    <center><asp:Button id="backButton" runat="server" text="Back" /></center>
    </center>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString2 %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString2.ProviderName %>" 
        SelectCommand="SELECT &quot;TITLE&quot;, &quot;ID&quot;, &quot;DESCRIPTION&quot;, &quot;WORKSHOPSTART&quot;, &quot;WORKSHOPFINISH&quot;, &quot;LOCATION&quot;, &quot;FIRSTNAME&quot;, &quot;LASTNAME&quot; FROM &quot;WORKSHOP&quot;, &quot;INFO&quot; WHERE (&quot;ID&quot; = :ID)">
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="1" Name="ID" QueryStringField="id" 
                Type="Decimal" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString2 %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString2.ProviderName %>" 
        SelectCommand="SELECT * FROM &quot;WORKSHOPS_TAKEN&quot; WHERE (&quot;WORKSHOP_ID&quot; = :WORKSHOP_ID)"
        InsertCommand="INSERT INTO &quot;WORKSHOPS_TAKEN&quot; (&quot;USERNAME&quot;, &quot;WORKSHOP_ID&quot;) VALUES (:username,:WORKSHOP_ID)"
        >
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="1" Name="WORKSHOP_ID" 
                QueryStringField="id" Type="Decimal" />
        </SelectParameters>
        <InsertParameters>
        <asp:QueryStringParameter DefaultValue="1" Name="WORKSHOP_ID" 
                QueryStringField="id" Type="Decimal" />
        <asp:Parameter Name ="username" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>
    </form>
</body>
</html>
